package iserver

// import "C"
type ServerType uint8
type ServerType2 = uint8

var serverTypeNames = map[ServerType]string{
	0:                 "0_UserClient",
	ServerTypeGateway: "1_GatewaySrv",
	ServerTypeClient:  "2_Client", //0也代表客户端
	ServerTypeSpace:   "3_SpaceSrv",
}

func RegisterServerType(name string, t ServerType) {
	serverTypeNames[t] = name
}
func (t ServerType) String() string {
	if v, ok := serverTypeNames[t]; ok {
		return v
	}
	return "Unknown"
}
func (t ServerType) Uint8() uint8 {
	return uint8(t)
}

const (
	_ = iota
	// ServerTypeGateway 网关服
	ServerTypeGateway

	// ServerTypeClient 客户端
	ServerTypeClient

	// ServerTypeSpace  带场景的服务器
	ServerTypeSpace
)

const (
	//MaxServerID 最大的服务器ID号
	MaxServerID = 1<<20 - 1
)

const GroupGlobalID uint32 = 0 // 通服的groupid, 所有分组的服务器都可以连
